home *** CD-ROM | disk | FTP | other *** search
XSetup plugin | 2001-01-21 | 2.4 KB | 89 lines |
- "FILE"="Xteq Systems X-Setup Plugin 5.0"
- "TYPE"="3"
- "COUNT"="4"
- "UIPATH"="Appearance\Files&Folders\Files"
- "NAME"="*.DOC Context Menu"
- "LANGUAGE"="VBScript"
- "TEXT 1"="(1) Name"
- "TEXT 2"="(1) Command"
- "TEXT 3"="(2) Name"
- "TEXT 4"="(2) Command"
- "DATA 1"=" "
- "DATA 2"="Executables (*.exe)|*.exe"
- "DATA 3"=" "
- "DATA 4"="Executables (*.exe)|*.exe"
- "DESCRIPTION 1"="The extension DOC (*.DOC) is used by many programs such as Microsoft Word and WordPad and others as well."
- "DESCRIPTION 2"="This plug-in will allow you to specify which program(s) you wish to use when opening files with the .DOC extension."
- "DESCRIPTION 3"="To remove the command(s), clear both the "Name" and the "Command" field and press "Apply"."
- "COMMENT 1"=" "
- "VERSION"="1.13"
- "AUTHOR"="Xteq Systems"
- "CONTACTURL"="http://www.xteq.com"
- "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
-
- 'Declaration of some constants
- sPathBase="HKCR\.doc\@"
- sPath1="" 'set later through code
- sPath2="" 'dito
- sCMD="Command\@" '*** this is always the same
-
- 'Called when the Plugin is started
- SUB Plugin_Initialize
- ' First check where this stuff goes to
- s=RegReadValue(sPathBase)
- if IsEmpty(s)=true then
- 'nothing found - we'll stick with .DOC
- s=".doc"
- end if
- sPath1="HKCR\" & s & "\Shell\XQXSETCMD1\"
- sPath2="HKCR\" & s & "\Shell\XQXSETCMD2\"
-
-
- Call ReadStuff(sPath1,1)
- Call ReadStuff(sPath2,3)
- END SUB
-
- 'Called when the Plugin should validate the Data the user has entered
- SUB Plugin_CheckData(ElementIndex)
- END SUB
-
- 'Called when the Plugin should apply the changes
- SUB Plugin_Apply(ElementIndex,ElementSubIndex)
- Call WriteStuff(sPath1,1)
- Call WriteStuff(sPath2,3)
- END SUB
-
- 'Called when the Plugin is about to be removed from memory
- SUB Plugin_Terminate
- END SUB
-
- 'User defined SUB's
- SUB ReadStuff(Path,UIStart)
- s=RegReadValue(Path & sCMD)
- if len(s)>0 then
- s=RegReadValue(Path & "@")
- SetUIElement UIStart,s
-
- s=RegReadValue(Path & sCMD)
- SetUIElement UIStart+1,s
- end if
-
- END SUB
-
- SUB WriteStuff(Path,UIStart)
- s1=GetUIElement(UIStart)
- s2=GetUIElement(UIStart+1)
-
-
- if len(s1)>0 or len(s2)>0 then
- Call RegWriteValue(Path & sCMD,s2,1)
- Call RegWriteValue(Path & "@",s1,1)
- else
- if IsEmpty(RegReadValue(Path & sCMD))=false then
- Call RegDeletePath(Path & "Command")
- Call RegDeletePath(Path)
- end if
- end if
-
- END SUB
-